package wk10p1;

class Pair<T> {
	private T x;
	private T y;
	public Pair() {}
	public Pair(T x_in, T y_in) {
		x = x_in;	y = y_in;
	}
	public T getX() {	return x;	}
	public T getY() {	return y;	}
	public String toString() {	return "[ " + x + ", " + y + " ]";	}
}

public class GenericPairsOfThings {
	public static void main(String[] args) {
		Pair<Integer> i = new Pair<>(7, 23);
		System.out.println(" i: " + i);
		Pair<Double> d = new Pair<Double>(7.45, 0.23e-4 );
		System.out.println(" d: " + d);
		Pair<String> s = new Pair<String>("Hello", "CSIS 235" );
		System.out.println(" s: " + s);
		
		Pair< Pair<String> > sp = new Pair< Pair<String> >( new Pair<String>("Hello", "CSIS 235"),
				new Pair<String>("This is", "Very Interesting!!"));
		System.out.println(" sp: " + sp);		
	}
}
